package com.livestocksolutions.ui;

import com.livestocksolutions.R;
import com.livestocksolutions.intent.BaseActivity;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

/* -- Version History --
 *  1.0 : 29 July 2012 - Initial version.
 */

/**
 * A base class to create the layout for the list of paddocks/Locations
 * @author Adam Parr
 * @version 1.0
 * 
 * @.modified 02 August 2012
 */
public class ListGroupMobArrayAdapter extends ViewGroupMobArrayAdapter {
	/**
	 * Number of animals in the Group/Mob position within the String[position][{@value #COUNT}]
	 * array passed in the Constructor.
	 */
	public static final int COUNT = 2;
 
	/**
	 * Constructor
	 * @param context The current context.
	 * @param values The Groups to represent in the ListView.
	 */
	public ListGroupMobArrayAdapter(BaseActivity context, String[][] values) {
		super(context, values);
	}
 
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		final View rowView = super.setView(position, convertView, parent);
		
		TextView groupName = (TextView) rowView.findViewById(R.id.groupName);
		TextView groupCount = (TextView) rowView.findViewById(R.id.groupCount);
		groupName.setText(values[position][NAME]);
		groupCount.setText(values[position][COUNT]);
		return rowView;
	}
}

